<template>
  <view class="page">
    <view class="kong"></view>
    <view class="tip" v-if="status==='kefu'">
      <view class="flex"> <u-icon name="checkmark-circle-fill" color="#FFBB50" size="12"></u-icon>联系客服</view>
      <image :src="imageUrl(obj.customer_service_qr_code.values)" mode="scaleToFill" />
      <view class="tip-number" @click="handleCall">{{obj.service_phone.values}}</view>
      <view class="tt"> 我是您的专属顾问，您可以扫描二维码添加我的微信，如有
        问题可以随时联系我~</view>
    </view>
    <view class="tip" v-else>
      <view class="flex"> <u-icon name="checkmark-circle-fill" color="#FFBB50" size="12"></u-icon>需求已提交</view>
      <view class="tt">你的需求已提交，工作人员会在24小时内会和您来联络！
        您也可以主动添加官服微信。</view>
      <image :src="imageUrl(obj.customer_service_qr_code.values)" mode="scaleToFill" />
      <view class="tip-number" @click="handleCall">{{obj.service_phone.values}}</view>
      <view class="tt"> 我是您的专属顾问，您可以扫描二维码添加我的微信，如有
        问题可以随时联系我~</view>
    </view>
    <view class="btn" @click="hanldeHome">进入首页</view>
  </view>
</template>
<script>
import { appletSetting } from "@/utils/request.js";
export default {
  data() {
    return {
      status: "kefu",
      obj:{}
    };
  },
  onLoad(options) {
    console.log(options)
    this.status = options.status;
    this.init()
  },
  computed: {
    imageUrl() {
      return (value) => {
        if (value) {
          const url = this.$config.showImgApi + value
          return url;
        }
        return '';
      }
    }
  },
  methods: {
    init(){
      appletSetting().then(res=>{
        this.obj=res
      })
    },
    hanldeHome(){
      uni.navigateTo({ url: '/pages/home/home' })
    },
    handleCall() {
      uni.makePhoneCall({
        phoneNumber: this.obj.service_phone.values,
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.page {
  background: #ffffff;
  .kong {
    height: 200rpx;
  }
  .btn{
    margin-top: 90rpx;
  }
  .flex {
    justify-content: center;
    ::v-deep .flex {
      margin-right: 11rpx;
    }
  }
  .tip {
    width: 637rpx;
    text-align: center;
    font-size: 25rpx;
    margin: 0 auto;
    .tt {
      font-size: 25rpx;
      margin-top: 32rpx;
    }
    image {
      width: 244rpx;
      height: 244rpx;
      margin: 50rpx auto 0;
    }
    .tip-number {
      font-size: 28rpx;
      color: #ffb850;
      text-decoration: underline;
      text-decoration-color: #ffb850;
    }
  }
}
</style>